<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>	
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Movement Register</title>
</head>
<body>
<div>
	<h1 align="center">Movement Register</h1>
</div> 
<br/>
<div>
<form method="get" action="movementRegister">
      <label for="select"></label>
      
    <strong>Select Month to View Staff On Leave :</strong>
    <select name="month">
        <option value="1" selected="selected">Jan</option>
        <option value="2">Feb</option>
        <option value="3">Mar</option>
        <option value="4">Apr</option>
        <option value="5">May</option>
        <option value="6">June</option>
        <option value="7">July</option>
        <option value="8">Aug</option>
        <option value="9">Sep</option>
        <option value="10">Oct</option>
        <option value="11">Nov</option>
        <option value="12" >Dec</option>
      </select>
      
    <input type="submit" value="Change"> 
    </form>
    </div>
	<div class="table-responsive">
  <table class="table">
        	<tr>
        <th><strong>No</strong></th>
        <th><strong>ID</strong></th>
        <th><strong>Name</strong></th>
        <th><strong>Type</strong></th>
        <th><strong>From</strong></th>
        <th><strong>To</strong></th>
        <th><strong>Details</strong></th>
      </tr>
      
	      <c:forEach items="${staffRecord}" var="user">
			<c:forEach items="${leaveRecord}" var="leave">
			<c:if test="${leave.id eq user.value.id }"  >
		      <tr>  
		      	<td><small>${user.key}</small></td>
		        <td><small>${user.value.id}</small></td>
		        <td><small>${user.value.name}</small></td>
		        <td><small>${leave.leaveType}</small></td>
		        <td><small>${leave.leaveStart}</small></td>
		        <td><small>${leave.leaveEnd}</small></td>
		        <td><small>${leave.comment}</small></td> 
		      </tr>
		      </c:if>
	      </c:forEach> 
      </c:forEach> 
		</table>
</body>
</html>